#ifndef DRAWAREA_H
#define DRAWAREA_H

#include "sortbase.h"
#include <QWidget>

class DrawArea : public QWidget
{
    Q_OBJECT
public:
    explicit DrawArea(QWidget *parent = nullptr);

    int getSortType() const;
    SortBase *getSortMethod() const;
    void setSortMethod(int type, SortBase *method);

public slots:
    void start(int count, int interval);
    void stop();
    void skip();

protected:
    void paintEvent(QPaintEvent *event) override;

signals:
    void runStateChanged(bool running);

private:
    int sortType{-1};
    SortBase *sortMethod{nullptr};
};

#endif // DRAWAREA_H
